package cn.tedu.service.impl;

import java.util.List;

import cn.tedu.dao.ClubDao;
import cn.tedu.entity.*;
import cn.tedu.service.ClubService;

public class ClubServiceImpl implements ClubService{

	ClubDao clubDao = new ClubDao();
	public List<FaxianClub> fxbList() {
		return clubDao.fxbList();
	}

	public List<ClubContent> conList() {
		return clubDao.conList();
	}

	public List<JoinClub> jList() {
		return clubDao.jList();
	}

	public List<ClubResource> resList() {
		return clubDao.resList();
	}
	

	/**
	 * 发现杯技术俱乐部介绍
	 *//*
	public List<FaxianClub> fxbList() {
		Connection conn = DBUtil.getConnection();
		List<FaxianClub> fList = new ArrayList<FaxianClub>();
		try {
			String sql = "select * from club limit 0,1";
			PreparedStatement ps =  conn.prepareStatement(sql);
			ResultSet rs = ps.executeQuery();
			while(rs.next()){
				FaxianClub fc = new FaxianClub();
				fc.setId(rs.getInt(1));
				fc.setTitle(rs.getString(2));
				fc.setImgURL(rs.getString(4));
				fc.setIntroduce(rs.getString(3));
				fList.add(fc);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			try {
				conn.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return fList;
	}

	*//**
	 * 俱乐部所涵盖的内容
	 *//*
	public List<ClubContent> conList() {
		Connection conn = DBUtil.getConnection();
		List<ClubContent> cList = new ArrayList<ClubContent>();
		try {
			String sql = "select * from club limit 1,8";
			PreparedStatement ps =  conn.prepareStatement(sql);
			ResultSet rs = ps.executeQuery();
			while(rs.next()){
				ClubContent cc = new ClubContent();
				cc.setId(rs.getInt(1));
				cc.setTitle(rs.getString(2));
				cc.setImgURL(rs.getString(4));
				cc.setIntroduce(rs.getString(3));
				cList.add(cc);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			try {
				conn.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return cList;
	}

	*//**
	 * 加入俱乐部
	 *//*
	public List<JoinClub> jList() {
		Connection conn = DBUtil.getConnection();
		List<JoinClub> jList = new ArrayList<JoinClub>();
		try {
			String sql = "select * from club limit 9,6";
			PreparedStatement ps =  conn.prepareStatement(sql);
			ResultSet rs = ps.executeQuery();
			while(rs.next()){
				JoinClub jc = new JoinClub();
				jc.setId(rs.getInt(1));
				jc.setTitle(rs.getString(2));
				jc.setImgURL(rs.getString(4));
				jc.setIntroduce(rs.getString(3));
				jList.add(jc);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			try {
				conn.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return jList;
	}

	*//**
	 * 丰富的俱乐部资源
	 *//*
	public List<ClubResource> resList() {
		Connection conn = DBUtil.getConnection();
		List<ClubResource> resList = new ArrayList<ClubResource>();
		try {
			String sql = "select * from club limit 15,4";
			PreparedStatement ps =  conn.prepareStatement(sql);
			ResultSet rs = ps.executeQuery();
			while(rs.next()){
				ClubResource cr = new ClubResource();
				cr.setId(rs.getInt(1));
				cr.setTitle(rs.getString(2));
				cr.setImgURL(rs.getString(4));
				cr.setIntroduce(rs.getString(3));
				resList.add(cr);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			try {
				conn.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return resList;
	}
*/
}
